﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NHibernate;
using DotNet.Common.NHibernateUtil;

namespace ZLCMS.Web.Wap.Shop
{
    public partial class Footer : System.Web.UI.UserControl
    {
        public string MenuId { get; set; }


        protected bool UnReadNotice { get; set; }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            UnReadNotice = false;

            if (!string.IsNullOrEmpty(Session[ZLCMS.Business.Util.GlobalSessionString.CurrentMemberAccount] as string))
            {
                using (ISession session = SessionFactoryHelper.CreateSession())
                {
                    UnReadNotice = session.CreateSQLQuery("select recid from member_msg_kind where status='0' and member_account=:acc")
                        .SetParameter("acc", Session[ZLCMS.Business.Util.GlobalSessionString.CurrentMemberAccount] as string)
                        .SetMaxResults(1)
                        .UniqueResult<int>() > 0;
                }
            }
        }

    }
}